x <- rnorm.mixt(n=10000, mus=0, sigmas=1, props=1)
fhat <- kde(x=x, h=hpi(x))
p1 <- pkde(fhat=fhat, q=c(-1, 0, 0.5))
qkde(fhat=fhat, p=p1) ## should be close to c(-1, 0, 0.5)
x1 <- rkde(fhat, n=100)
plot(fhat)
fhat1 <- kde(x=x1, h=hpi(x1))
plot(fhat1, add=TRUE, col=2)
fhat2 <- dkde(x=x1, fhat=fhat1)
points(x1, fhat2, col=3)
Run the code above in your browser using DataLab